#ifndef Functions_H
	#define Functions_H
	#include <string>
	class Function
	{
	public:
		Function();
		virtual ~Function();
		virtual double F(double x) = 0;
		
	};

	class BinaryOperator:public Function
	{
	protected:
		Function * left;
		Function * right;
	public:
		BinaryOperator(Function * a, Function * b);
		virtual ~BinaryOperator();
		virtual double F(double x) = 0;
	};

	class Plus: public BinaryOperator
	{
	public:
		Plus(Function * a, Function * b);
		virtual ~Plus();
		double F(double x);
	};
	
	class Minus: public BinaryOperator
	{
	public:
		Minus(Function * a, Function * b);
		virtual ~Minus();
		double F(double x);
	};

	class Mull: public BinaryOperator
	{
	public:
		Mull(Function * a, Function * b);
		virtual ~Mull();
		double F(double x);
	};
	
	class Div: public BinaryOperator
	{
	public:
		Div(Function * a, Function * b);
		virtual ~Div();
		double F(double x);
	};

	class Const: public Function
	{
	private:
		double const value;
	public:
		Const(double x);
		virtual ~Const();
		double F(double x);
	};

	class Var: public Function
	{
	public:
		Var();
		virtual ~Var();
		double F(double x);
	};

	class Typer
	{
	public:
		static Function * newFunction(Function * a, Function * b, std::string type);
		static Function * newFunction(double x);
		static Function * newFunction();
	};
#endif